package edu.unsw.comp9321.common;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class SearchBean implements Serializable{

	private static final long serialVersionUID = 1L;
	
	private List<CarBean> cars;
	
	public SearchBean(){
		setCars(new ArrayList<CarBean>());
	}

	public List<CarBean> getCars() {
		return cars;
	}

	public void setCars(List<CarBean> cars) {
		this.cars = cars;
	}

	public CarBean getCarBeanWithId(int carId) {
		CarBean carBean = null;
		for (CarBean bean: this.cars) {
			if (bean.getCar().getCarId() == carId) {
				carBean = bean;
			}
		}
		return carBean;
	}
}
